﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OrderingPlatform.Infrastructure;

namespace OrderingPlatform.DalService.CommonManage
{
    public class FileDal
    {
        public void SaveFile(File file)
        {
            using (var db = new OrderingPlatformDbEntities())
            {
                db.Files.Add(file);
                db.SaveChanges();
            }
        }
        public File GetFile(Guid fileId)
        {
            using (var db = new OrderingPlatformDbEntities())
            {
                return db.Files.FirstOrDefault(a => a.FileId == fileId);
            }
        }
    }
}
